﻿using Wicture.DbRESTFul;

namespace Wicture.QPZS.Parts
{
    public class ElasticSearchConfig
    {
        public string ElasticSearchUrl { get; set; }
        public string ElasticSearchIndex { get; set; }
        public string ElasticSearchUserName { get; set; }
        public string ElasticSearchPassword { get; set; }

        private static ElasticSearchConfig config;
        public static ElasticSearchConfig Config
        {
            get
            {
                if (config == null) config = new ElasticSearchConfig
                {
                    ElasticSearchUrl = ConfigurationManager.Settings.Variables["ElasticSearch.Url"],
                    ElasticSearchIndex = ConfigurationManager.Settings.Variables["ElasticSearch.Index"],
                    ElasticSearchUserName = ConfigurationManager.Settings.Variables["ElasticSearch.UserName"],
                    ElasticSearchPassword = ConfigurationManager.Settings.Variables["ElasticSearch.Password"],
                };
                return config;
            }
        }
    }
}
